//
//  ForumCell.m
//  一键车讯
//
//  Created by Rabbit on 14-10-27.
//  Copyright (c) 2014年 lanou.3g.com. All rights reserved.
//

#import "ForumCell.h"
#import "Forum.h"
#import "UIImageView+WebCache.h"

@implementation ForumCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        
        self.titleLabel = [[UILabel alloc] init];
        [self.contentView addSubview:_titleLabel];
        
        self.imgView = [[UIImageView alloc] init];
        [self.contentView addSubview:_imgView];
        
//        _floorLabel = [[UILabel alloc] init];
//        [self.contentView addSubview:_floorLabel];
//        
//        _bbsLabel = [[UILabel alloc] init];
//        [self.contentView addSubview:_bbsLabel];

        [_titleLabel release];
        [_imgView release];
//        [_floorLabel release];
//        [_bbsLabel release];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.imgView.frame = CGRectMake(3, 3, self.contentView.frame.size.width / 3 - 20, self.contentView.frame.size.height - 5);
    self.imgView.backgroundColor = [UIColor yellowColor];
    [self.imgView setImageWithURL:[NSURL URLWithString:self.forum.image]];
    
    self.titleLabel.frame = CGRectMake(self.contentView.frame.size.width / 3, 20, self.contentView.frame.size.width / 3 * 2 - 20, self.contentView.frame.size.height);
    self.titleLabel.font = [UIFont systemFontOfSize:14];
    self.titleLabel.numberOfLines = 0;
    [self.titleLabel sizeToFit];
    
//    self.floorLabel.frame = CGRectMake(self.contentView.frame.size.width / 3 - 20, 20, self.contentView.frame.size.width / 3 * 20, self.contentView.frame.size.height / 2);
//    self.bbsLabel.frame = CGRectMake(self.contentView.frame.size.width / 3 - 20, 20, self.contentView.frame.size.width / 3 * 20, self.contentView.frame.size.height / 2); 
}

- (void)dealloc
{
    [_titleLabel release];
//    [_floorLabel release];
//    [_bbsLabel release];
    [_imgView release];
    [super dealloc];
}

- (void)awakeFromNib
{
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
